package com.wyx.controller;


import com.wyx.entity.Student;
import com.wyx.service.StudentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wyx
 * @since 2022-03-15
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Resource
    private StudentService ss;

    @GetMapping("/")
    public Map<String, Object> selectAll(){
        List<Student> list = ss.list();
        return new HashMap<String, Object>(){{
            put("status","success");
            put("student",list);
        }};
    }
}

